package ch.tranchida.demo;

import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.commons.lang.StringUtils;

/**
 * Created by IntelliJ IDEA.
 * User: giampaolo
 * Date: 12.12.10
 * Time: 07:01
 * To change this template use File | Settings | File Templates.
 */
public class ErrorProcessor implements Processor {

    public void process(Exchange exchange) throws Exception {
        Message in = exchange.getIn();
        if (StringUtils.equals(in.getHeader(Exchange.FILE_NAME, String.class), "test.xml")) {
            throw new Exception("test");
        }
    }
}
